API Documentation
PtrPool.h
1 // Pool.h
3 //
5 
6 namespace nkMemory
7 {
13  template <typename T>
14  class PtrPool final
15  {
16  public :
17 
24  PtrPool (Allocator<T>* allocator = new DefaultAllocator<T> (), Deallocator<T>* deallocator = new DefaultDeallocator<T> ()) ;
25 
29  ~PtrPool () ;
30 
34  size_t getPoolSize () const ;
38  size_t getFreeItemsCount () const ;
42  size_t getFlyingItemsCount () const ;
43 
49  T* getObject () ;
55  void releaseObject (T* object) ;
56  } ;
57 }
nkMemory::PtrPool::~PtrPool
~PtrPool()
nkMemory::PtrPool::getObject
T * getObject()
nkMemory::Allocator
Interface representing an allocator, supposed to allocate an object when requested.
Definition: Allocator.h:15
nkMemory::DefaultDeallocator
A utility default deallocator using a simple call to delete.
Definition: DefaultDeallocator.h:13
nkMemory::DefaultAllocator
A utility default allocator allocating an object through a simple call to new.
Definition: DefaultAllocator.h:13
nkMemory::Deallocator
Interface used for deallocating memory.
Definition: Deallocator.h:13
nkMemory::PtrPool::PtrPool
PtrPool(Allocator< T > *allocator=new DefaultAllocator< T >(), Deallocator< T > *deallocator=new DefaultDeallocator< T >())
nkMemory::PtrPool::getFreeItemsCount
size_t getFreeItemsCount() const
nkMemory::PtrPool::releaseObject
void releaseObject(T *object)
nkMemory::PtrPool::getPoolSize
size_t getPoolSize() const
nkMemory::PtrPool::getFlyingItemsCount
size_t getFlyingItemsCount() const
nkMemory::PtrPool
A pool of objects, allocated in the heap and tracked by their pointers.
Definition: PtrPool.h:15
nkMemory
Encompasses all API of component NilkinsMemory.
Definition: Allocator.h:7